function foo() {
    var myName = 'Jack';
    let a = 1;
    const b = 2;
    var innerBar = {
        getName: function() {
            console.log(a);
            return myName;
        },
        setName: function(newName) {
            myName = newName;
        }
    }
    return innerBar;
}

var bar = foo();
bar.setName('Mary');
bar.getName();
console.log(bar.getName())

// 1
// 1
// Mary

